#ifndef PIXMAP_H_INCLUDED
#define PIXMAP_H_INCLUDED

#include "libafx.h"
#include "axelynx_error.h"

namespace axelynx
{
    class PixMap
    {
        public:

        class FileFormat
        {
            public:
            virtual int LoadPixMapFile(PixMap *p, std::string filename) = 0;
            virtual int SavePixMapFile(PixMap *p, std::string filename) = 0;
            virtual int LoadPixMapMem(PixMap *p, void *mem, size_t sz) = 0;
            virtual int SavePixMapMem(PixMap *p, void *mem, size_t max_sz) = 0;
            virtual ~FileFormat();

            virtual int CountAssignedExt();
            virtual std::string AssignedExt(int i);
        };

        virtual int Load(const char* filename) = 0;
        virtual int Save(const char* filename) = 0;
        virtual int Load(void *mem, size_t sz) = 0;
        virtual int Save(void *mem, size_t max_sz) = 0;

        virtual int GetWidth() = 0;
        virtual int GetHeight() = 0;
        virtual int GetNumChannels() = 0;
        virtual int GetChannelSize() = 0;

        FUNC_EXPORT static int RegisterFormat(const PixMap::FileFormat *formatf);
    };
}

#endif // PIXMAP_H_INCLUDED
